using System;
using NUnit.Framework;
using DotNetXmlSwfChart;

namespace DotNetXmlSwfChart.UnitTest
{
    [TestFixture]
    public class ChartRectangleFixture
    {
        [Test]
        public void ToSourceXml()
        {
            string testXml =
                "<chart_rect x='20' " +
                            "y='40' " +
                            "width='30' " +
                            "height='50' " +
                            "positive_color='ffffff' " +
                            "negative_color='000000' " +
                            "positive_alpha='1' " +
                            "negative_alpha='2' " +
                            "/>";
            ChartRectangle cr = new ChartRectangle();
            cr.X = 20;
            cr.Y = 40;
            cr.Width = 30;
            cr.Height = 50;
            cr.PositiveColor = "ffffff";
            cr.NegativeColor = "000000";
            cr.PositiveAlpha = 1;
            cr.NegativeAlpha = 2;
            Assert.AreEqual(testXml, cr.ToSourceXML());
        }
    }
}
